package main

import (
	"fmt"
	"regexp"
)

// topk(10, disk_free{job="$job",instance="$instance"})
// disk_free{job=\"$job\",instance=\"$instance\"}
// {"job": "", "instance": "10.20.0.10"}
func replaceLabels(label string, labelMap map[string]string) (string){
	reg := regexp.MustCompile(`{(.*?)}`)
	tmpList := reg.FindAllStringSubmatch(label, -1)
	fmt.Println(1111, tmpList)
	fmt.Println(reg.FindAllStringIndex(label, -1))

	return ""


}

func main(){
	label := "topk(10, disk_free{job=\"$job\",instance=\"$instance\"} + up{job=\"$job\"})"

	labelMap := map[string]string{
		"job": "",
		"instance": "10.20.0.10",
	}
	fmt.Println(replaceLabels(label, labelMap))
}

